<?php


namespace app\common\model;


use think\Model;

class Forum extends Model
{
    public function forumCate(){
        return $this->belongsTo('forumCate')->bind([
            'forum_cate_name'=>'name'
        ]);
    }
    public function user(){
        return $this->belongsTo('user')->bind([
            'user_nickname'=>'nickname'
        ]);
    }

    public function getDescAttr($value,$data){
        return mb_substr($data['content'],0,80);
    }
    public function getAddressFullAttr($value,$data){
        return $data['province'].$data['city'].$data['area'];
    }
}
